<tr>
  <th rowspan="<%= 6 + @roles.length %>"><%= l('cmi.label_advance') %></th>
  <th rowspan="<%= 1 + @roles.length %>"><%= l('cmi.label_effort_plural') %></th>

  <% @roles.each do |role| %>
    <td><%=h role %></td>
    <% @reports.each do |report| %>
      <td class="issue">
        <%= (report.effort_percent_by_role(role)).round(2) rescue '--' %> %
      </td>
    <% end %>
    </tr>
    <tr>
  <% end %>

  <td><%= l(:label_project) %></td>
  <% @names.each do |report| %>
    <%value_esf_proyect = get_report_value(report, 'effort_real', 'effort_done') %>
    <td class="issue"><%= value_esf_proyect != 0.0? value_esf_proyect : "--"%> % </td>
    <% set_value('esf_proyect', report, 'effort_real', 'effort_done') %>
  <% end %>
</tr>
<tr>
  <th rowspan=1 colspan="2"><%= l('cmi.label_time') %></th>
  <% @names.each do |report| %>
    <%value_time = get_report_value(report, 'time_total_real', 'time_done') %>
    <td class="issue"><%= value_time != 0.0? value_time : "--" %> % </td>
    <% set_value('time', report, 'time_total_real', 'time_done') %>
  <% end %>
</tr>

<tr>
  <th rowspan=3><%= l('cmi.label_budgets') %></th>
  <td><%= l('cmi.label_RRHH') %></td>
  <% @names.each do |report| %>
    <%value_budget_rrhh = get_report_value(report, 'budget_real_rrhh', 'budget_spent_rrhh') %>
    <td class="issue"><%= value_budget_rrhh != 0.0? value_budget_rrhh : "--" %> %</td>
    <% set_value('budget_rrhh', report, 'budget_real_rrhh', 'budget_spent_rrhh') %>
  <% end %>
</tr>
<tr>
  <td><%= l('cmi.label_others') %></td>
  <% @names.each do |report| %>
    <%value_budget_others = get_report_value(report, 'Presupuesto_actual', 'Gastado') %>
    <td class="issue"><%= value_budget_others != 0.0? value_budget_others : "--" %> %</td>
    <% set_value('budget_others', report, 'Presupuesto actual', 'Gastado') %>
  <% end %>
</tr>
<tr>
  <td><%= l(:label_total) %></td>
  <% @names.each do |report| %>
    <%value_budget_total = get_report_value(report, 'budget_real', 'budget_spent') %>
    <td class="issue"><%= value_budget_total != 0.0? value_budget_total : "--" %> %</td>
    <% set_value('budget_total', report, 'budget_real', 'budget_spent') %>
  <% end %>
</tr>
<tr>
  <th colspan="2"><%= l('cmi.label_graphs') %></th>
  <% @names.each do |report| %>
    <td class="issue">
      <img src="http://chart.apis.google.com/chart?cht=bhs&chd=t:<%=instance_variable_get("@value_esf_proyect_#{report}")%>,<%=instance_variable_get("@value_time_#{report}")%>,<%=instance_variable_get("@value_budget_total_#{report}")%>|100,100,100&chco=4D89F9,C6D9FD&chbh=10,5,10&chs=250x70&chxt=x,y&chxl=0:|0|50|100|1:|Coste: <%=instance_variable_get("@value_budget_total_#{report}")%>%|Tiempo: <%=instance_variable_get("@value_time_#{report}")%>%|Esfuerzo: <%=instance_variable_get("@value_esf_proyect_#{report}")%>%|"/>
    </td>
  <% end %>
</tr>
